<script lang="ts" setup>
import { ref } from 'vue'
const showTop = ref(false)
const active = ref(0)

function showClick() {
    showTop.value = !showTop.value
}

</script>

<template>
    <div class="order">
        <header class="order-header">
            <div class="back" @click="$router.back()">
                <svg t="1731383206890" class="icon" viewBox="0 0 1024 1024" version="1.1"
                    xmlns="http://www.w3.org/2000/svg" p-id="2340" width="18" height="18">
                    <path
                        d="M733.090909 977.454545a23.202909 23.202909 0 0 1-16.453818-6.818909l-442.181818-442.158545a23.202909 23.202909 0 0 1 0-32.907636l442.181818-442.205091a23.249455 23.249455 0 1 1 32.907636 32.907636L323.816727 512.023273l425.728 425.704727A23.249455 23.249455 0 0 1 733.090909 977.454545z"
                        fill="" p-id="2341"></path>
                </svg>
            </div>
            <div class="title" @click="showClick">门票订单<span style="margin-left: 5px;"><van-image
                        :src="showTop ? ' https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%85%92%E5%BA%97%E8%AE%A2%E5%8D%95/u1581.svg' : 'https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%85%92%E5%BA%97%E8%AE%A2%E5%8D%95/u1573.svg'"></van-image></span>
            </div>

            <van-image
                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%85%92%E5%BA%97%E8%AE%A2%E5%8D%95/u1586.svg"
                @click="$router.push('/home/search')"></van-image>
        </header>
        <div class="order-nav" v-show="showTop">
            <div class="left">
                <p :class="{ active: active === 0 }" @click="active = 0">门票订单</p>
                <p :class="{ active: active === 1 }" @click="active = 1">机票订单</p>
            </div>
            <div class="right">
                <p :class="{ active: active === 2 }" @click="active = 2">酒店订单</p>
                <p :class="{ active: active === 3 }" @click="active = 3">车票订单</p>
            </div>

        </div>

        <van-tabs v-model:active="active" sticky>
            <van-tab title="全部">
                <div class="order-content">
                    <div v-for="item in 5" :key="item" style="margin-top: 10px;">
                        <div class="top">
                            <van-image style="width: 25px;height: 25px;position: relative;top: 15px;"
                                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%97%A8%E7%A5%A8%E8%AE%A2%E5%8D%95/u3127.svg"></van-image>
                            <div class="left">
                                <p style="font-size: 17px;color: #000;font-weight: bold;">门票</p>
                                <p style="font-size: 16px;color: #000;">故宫博物馆成人票</p>
                                <p style="font-size: 14px;color: #666;">11月26日有效 • 1份</p>
                                <p style="font-size: 14px;color: #666;">凭「电子凭证」取票使用</p>
                            </div>
                            <div class="right">
                                <p style="font-size: 15px;color: #3478F6;">待支付</p>
                                <p
                                    style=" color: #f66; font-size: 24px; font-weight: bold; position: relative; top: -40px;">
                                    ￥50
                                </p>
                            </div>
                        </div>
                        <div class="order-footer">
                            <button
                                style=" width: 80px;height: 30px;background-color: #ccc;color: #555;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">取消</button>
                            <button
                                style="width: 80px;height: 30px;background-color: #3478F6;color: white;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">支付</button>

                        </div>
                    </div>
                </div>
            </van-tab>
            <van-tab title="待支付">
                <div class="order-content">
                    <div v-for="item in 5" :key="item" style="margin-top: 10px;">
                        <div class="top">
                            <van-image style="width: 25px;height: 25px;position: relative;top: 15px;"
                                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%97%A8%E7%A5%A8%E8%AE%A2%E5%8D%95/u3127.svg"></van-image>
                            <div class="left">
                                <p style="font-size: 17px;color: #000;font-weight: bold;">门票</p>
                                <p style="font-size: 16px;color: #000;">故宫博物馆成人票</p>
                                <p style="font-size: 14px;color: #666;">11月26日有效 • 1份</p>
                                <p style="font-size: 14px;color: #666;">凭「电子凭证」取票使用</p>
                            </div>
                            <div class="right">
                                <p style="font-size: 15px;color: #3478F6;">待支付</p>
                                <p
                                    style=" color: #f66; font-size: 24px; font-weight: bold; position: relative; top: -40px;">
                                    ￥80
                                </p>
                            </div>
                        </div>
                        <div class="order-footer">
                            <button
                                style=" width: 80px;height: 30px;background-color: #ccc;color: #555;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">取消</button>
                            <button
                                style="width: 80px;height: 30px;background-color: #3478F6;color: white;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">支付</button>

                        </div>
                    </div>
                </div>
            </van-tab>
            <van-tab title="未使用">
                <div class="order-content">
                    <div v-for="item in 5" :key="item" style="margin-top: 10px;">
                        <div class="top">
                            <van-image style="width: 25px;height: 25px;position: relative;top: 15px;"
                                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%97%A8%E7%A5%A8%E8%AE%A2%E5%8D%95/u3127.svg"></van-image>
                            <div class="left">
                                <p style="font-size: 17px;color: #000;font-weight: bold;">门票</p>
                                <p style="font-size: 16px;color: #000;">故宫博物馆成人票</p>
                                <p style="font-size: 14px;color: #666;">11月26日有效 • 1份</p>
                                <p style="font-size: 14px;color: #666;">凭「电子凭证」取票使用</p>
                            </div>
                            <div class="right">
                                <p style="font-size: 15px;color: #3478F6;">待支付</p>
                                <p
                                    style=" color: #f66; font-size: 24px; font-weight: bold; position: relative; top: -40px;">
                                    ￥10
                                </p>
                            </div>
                        </div>
                        <div class="order-footer">
                            <button
                                style=" width: 80px;height: 30px;background-color: #ccc;color: #555;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">取消</button>
                            <button
                                style="width: 80px;height: 30px;background-color: #3478F6;color: white;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">支付</button>

                        </div>
                    </div>
                </div>
            </van-tab>
            <van-tab title="待评价">
                <div class="order-content">
                    <div v-for="item in 5" :key="item" style="margin-top: 10px;">
                        <div class="top">
                            <van-image style="width: 25px;height: 25px;position: relative;top: 15px;"
                                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E5%85%A8%E9%83%A8%E9%97%A8%E7%A5%A8%E8%AE%A2%E5%8D%95/u3127.svg"></van-image>
                            <div class="left">
                                <p style="font-size: 17px;color: #000;font-weight: bold;">门票</p>
                                <p style="font-size: 16px;color: #000;">故宫博物馆成人票</p>
                                <p style="font-size: 14px;color: #666;">11月26日有效 • 1份</p>
                                <p style="font-size: 14px;color: #666;">凭「电子凭证」取票使用</p>
                            </div>
                            <div class="right">
                                <p style="font-size: 15px;color: #3478F6;">待支付</p>
                                <p
                                    style=" color: #f66; font-size: 24px; font-weight: bold; position: relative; top: -40px;">
                                    ￥90
                                </p>
                            </div>
                        </div>
                        <div class="order-footer">
                            <button
                                style=" width: 80px;height: 30px;background-color: #ccc;color: #555;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">取消</button>
                            <button
                                style="width: 80px;height: 30px;background-color: #3478F6;color: white;border: none;border-radius: 5px;font-size: 14px;cursor: pointer;">支付</button>

                        </div>
                    </div>
                </div>
            </van-tab>
        </van-tabs>

    </div>
</template>


<style scoped lang="scss">
.order {
    width: 100%;
    height: 100%;

    .order-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 50px;
        padding: 0 20px;
        margin-top: 20px;

        z-index: 10;
    }

    .order-nav {
        width: 100%;
        display: flex;
        background-color: white;
        justify-content: space-around;
        align-items: center;
        position: absolute;
        z-index: 999;

        p {
            width: 100px;
            text-align: center;
            padding: 10px;
            border: 1px solid #ccc;
            color: #555;
        }

        .active {
            color: #3478F6;
            border: 1px solid #3478F6;
        }
    }

    .order-content {
        width: 100%;
        height: 100%;

        .top {
            width: 90%;
            height: 180px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            box-shadow: 0px 0px 10px #ccc;
            padding: 10px;
            border-radius: 10px;

            .left {
                position: relative;
                right: 40px;

            }


            .right {
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                align-items: flex-end;
                margin-right: 20px;
            }


        }

        .order-footer {
            position: relative;
            left: 150px;
            top: -40px;

            button {
                margin-left: 20px;
            }

        }
    }
}
</style>